package com.netty;

import com.config.HsProperty;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/***
 * @author: mcq
 * Date : 2024/9/16 
 * 人を信じよ、しかしその百倍も自らを信じよ
 *
 * Desc:  
 */
@Service
public class MyHeartStart implements ApplicationRunner {

    @Resource
    private HsProperty hsProperty;


    @Override
    public void run(ApplicationArguments args) throws Exception {
        if (hsProperty.isStartConnect()) {
            MyClient.ip = hsProperty.getIp();
            MyClient.port = hsProperty.getPort();
            MyClient.user = hsProperty.getUsername();
            MyClient.password = hsProperty.getPassword();

            MyClient.connect();
        }
    }
}
